<template>
    <div class="mt-[20px]">
        <div class="item">
            <button class="close-btn flex items-center justify-center" @click="$emit('close')">
                <img :src="close.src" alt="" class="w-[16px] h-[16px]">
            </button>
            <div class="flex row">
                <div class="shrink-0">
                    <div class="thumbnail" :class="{ 'checked': activedIndex == 0 }"
                        @click="() => { largeImg = item.img; activedIndex = 0 }"><img :src="item.img" alt="" class="w-full h-full">
                    </div>
                    <div class="thumbnail" :class="{ 'checked': activedIndex == 1 }"
                        @click="() => { largeImg = item.img1; activedIndex = 1 }"><img :src="item.img1" alt=""
                            class="w-full h-full"></div>
                </div>
                <div class="large shrink-0">
                    <img :src="largeImg" alt="" class="w-full h-full">
                </div>

                <div>
                    <div class="title">{{ item.title }}</div>
                   
                    <div class="content">
                        <div class="text-brown text-[20px] mb-[10px] hover:underline cursor-pointer">查看此评估套件详细信息</div>
                        {{ item.content }}</div>
                </div>

            </div>
            <div>
                <span class="pb-[10px] font-medium text-[20px]">相关资源</span>
                <ul>
                    <li v-for="item in resourceList" class="flex mb-[10px] hover:underline cursor-pointer">
                        <span class="w-[204px] text-brown">{{ item.title }}</span>
                        <img :src="路径4.src" alt="" class="w-[15px] h-[17px] icon3">
                        <img :src="路径3.src" alt="" class="w-[15px] h-[17px] icon4 hidden">

                    </li>
                </ul>
            </div>

        </div>
    </div>
</template>
<script setup>
import { ref } from 'vue'
import ES5030 from '@assets/ES5030(1).png'
import 评估版2 from '@assets/评估版2.png'
import 路径3 from '@assets/路径 (3).png'
import 路径4 from '@assets/路径 (4).png'
import close from '@assets/close.png'



import magnifier from '@assets/magnifier.png'
const activedIndex = ref(0)
const largeImg = ref(ES5030.src)
const item = ref(
    {
        title: 'EVB-ES5030',
        content: `评估板 EVB-ES5030 是一款微型 3A 同步降压稳压器。
ES5030 的封装为6 引脚 1.5mm × 1.5mm DFN 封装。ES5030是一款紧凑型、高效率、高速同步单片式降压开关稳压器，工作静态电流仅为 55μA。
高压侧和低压侧电源开关、补偿元件和其他必要的电路都在集成电路内部，从而最大限度地减少了外部元件，简化了设计。
演示板上安装了 EMI 滤波器。电路板(带 EMI 滤波器的辐射)EMI 性能.....`,
        img: ES5030.src,
        img1: 评估版2.src,
    }
)
const resourceList = ref([
    { title: 'EVB-ES5030-Demo Manual', type: 0 },
    { title: 'EVB-ES5030-Schematic', type: 1 },
    { title: 'EVB-ES5030-Design Files', type: 1 },


])
</script>
<style lang="scss" scoped>
.item{
    border-radius: 8px;
    overflow: hidden;
}
.close-btn {
    border-radius: 0px NaNpx 0px NaNpx;
    opacity: 1;
    position: absolute;
    right: 0;
    top: 0;
    background: #712C2F;
    width: 40px;
    height: 30px;
}

li:hover {
    .icon3 {
        display: none;
    }

    .icon4 {
        display: block;

    }
}

.row {
    border-bottom: 1px solid #D8D8D8;
}

.thumbnail {
    width: 116px;
    height: 80px;
    border-radius: 2px;
    margin-bottom: 7px;
    padding: 4px;
    box-sizing: border-box;
    border: 1px solid rgba(51, 51, 51, 0.3);
}

.large {
    width: 392px;
    height: 266px;
    border-radius: 2px;
    opacity: 1;
    background: #FFFFFF;
    box-sizing: border-box;
    border: 1px solid rgba(51, 51, 51, 0.3);
    padding: 10px;
    box-sizing: border-box;
    margin-left: 22px;
    margin-bottom: 24px;
}

.checked {
    border: 1px solid #712C2F;
}

.magnifier-btn {
    width: 40px;
    height: 30px;
    border-radius: 2px 0px 2px 0px;
    opacity: 1;
    display: flex;
    justify-content: center;
    align-items: center;
    background: #712C2F;
    position: absolute;
    right: 0;
    bottom: 0;
    cursor: pointer;
}

.content {
    font-family: Source Han Sans;
    font-size: 14px;
    font-weight: normal;
    line-height: normal;
    color: #3D3D3D;
    padding-left: 16px;
    padding-right: 16px;
    box-sizing: border-box;
    height: 215px;
    margin-left: 49px;
    overflow-y: scroll;
}

.title {
    font-family: Source Han Sans;
    font-size: 20px;
    font-weight: 500;
    color: #333333;
    margin-bottom: 20px;
    padding-left: 16px;
    padding-right: 16px;
    box-sizing: border-box;
}

.img-box {
    border-bottom: 1px solid #D8D5D5;
}

.item {
    width: 100%;
    height: 478px;
    opacity: 1;
    border: 1px solid #D8D5D5;
    position: relative;
    border-radius: 8px;
    opacity: 1;
    background: #FFFFFF;
    box-shadow: 0px 4px 10px 0px rgba(0, 0, 0, 0.3);
    padding: 30px;
    box-sizing: border-box;
    position: relative;
}</style>